Skip to content

Prevent replacement of {\d+} sequences in chat.format and remove stray '#285

Closed
zford wants to merge 1 commit into
essentials:2.9from
zford:chat-braces-fix
Closed

Prevent replacement of {\d+} sequences in chat.format and remove stray '#285
zford wants to merge 1 commit into
essentials:2.9from
zford:chat-braces-fix

Conversation

@zford
Copy link
Copy Markdown
Contributor

@zford zford commented Jan 24, 2013

This fixes issues presented by khobbits with the latest chat.format brace fix.

https://github.com/phrstbrn/Essentials/commit/8fde5102b9161cda2267d3638c15dc6fda48a7fd#commitcomment-2494321

Unfortunately the regex to fix it is gross (and largely unreadable), however, it does fix the issue and a few other edge cases.

@khobbits
Copy link
Copy Markdown
Member

I'm not sure this can be considered an improvement :s

@zford
Copy link
Copy Markdown
Contributor Author

zford commented Jan 25, 2013

Oh come on, everybody knows what (?:^|(?<=[^\d'])|(?<=\d'}'))([{}][{}']*)(?:$|(?=[^\d'])|(?='{'\d)) does!

In all seriousness, it does fix the actual problem presented with that commit. I couldn't figure out a cleaner way of doing it without that nasty regex.

@khobbits
Copy link
Copy Markdown
Member

This feels more like a hack than a fix, i'd rather not have such a horrible regex in there, for readability, maintainability and performance reasons.

@zford zford closed this Feb 4, 2013
@zford zford deleted the chat-braces-fix branch February 4, 2013 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants